package com.hdjk.view.fragment.main;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;

import com.hdjk.view.activity.main.FirstInstallActivity;

public class WelFragment extends Fragment {
	private Context mContext;
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		mContext=inflater.getContext();
		ImageView imageView = new ImageView(mContext);
		imageView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
				LayoutParams.MATCH_PARENT));
		imageView.setScaleType(ScaleType.CENTER_CROP);
		
		int drawableId=getArguments().getInt("drawableId", 0);
		imageView.setImageResource(drawableId);
		boolean isLast=getArguments().getBoolean("isLast", false);
		if(isLast){
			imageView.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View arg0) {
					((FirstInstallActivity)mContext).intentToPage();
				}
			});
		}
		return imageView;
	}
}
